﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Popup.Master" CodeBehind="UploadPopup.aspx.cs"
    Inherits="VSM.UploadPopup" EnableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:HiddenField ID="file_name1" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="file_type1" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="file_name2" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="file_type2" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="file_name3" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="file_type3" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="file_name4" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="file_type4" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="file_name5" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="file_type5" ClientIDMode="Static" runat="server" />
    <script type="text/javascript">
        function GetFileName(oFile, fileNo) {
            var FullName = oFile.value.split('\\')
            var FileName = FullName[FullName.length - 1]
            switch(fileNo)
            {
                case "1":
                    document.getElementById("txtTitle1").value = FileName.split('.')[0]
                    document.getElementById("file_name1").value = FileName
                    if(FileName.split('.').length > 1)
                        document.getElementById("file_type1").value = FileName.split('.')[1]
                    break;
                case "2":
                    document.getElementById("txtTitle2").value = FileName.split('.')[0]
                    document.getElementById("file_name2").value = FileName
                    if (FileName.split('.').length > 1)
                        document.getElementById("file_type2").value = FileName.split('.')[1]
                    break;
                case "3":
                    document.getElementById("txtTitle3").value = FileName.split('.')[0]
                    document.getElementById("file_name3").value = FileName
                    if (FileName.split('.').length > 1)
                        document.getElementById("file_type3").value = FileName.split('.')[1]
                    break;
                case "4":
                    document.getElementById("txtTitle4").value = FileName.split('.')[0]
                    document.getElementById("file_name4").value = FileName
                    if (FileName.split('.').length > 1)
                        document.getElementById("file_type4").value = FileName.split('.')[1]
                    break;
                case "5":
                    document.getElementById("txtTitle5").value = FileName.split('.')[0]
                    document.getElementById("file_name5").value = FileName
                    if (FileName.split('.').length > 1)
                        document.getElementById("file_type5").value = FileName.split('.')[1]
                    break;
            }
        }
    </script>
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <div style="height: 88%; overflow: scroll">
                    <table style="width: 100%; border: 1px;" cellpadding="3" cellspacing="0">
                        <tr>
                            <td class="FormLineItemAlt" style="width: 20%; text-align: center;">
                                <asp:Label ID="lblFileUpload" runat="server" Text=" Files Upload"></asp:Label>
                            </td>
                            <td class="FormLineItemAlt"style="text-align: center;">
                                <asp:Label ID="lblTitle" Text="Title" runat="server"></asp:Label>
                            </td>
                            <td class="FormLineItemAlt"style="width: 70px; text-align: center;">
                                <asp:Label ID="lblOptional" Text="Optional" runat="server"></asp:Label>
                            </td>
                            <td class="FormLineItemAlt" style="width: 110px; text-align: center;">
                                <asp:Label ID="lblPublishDate" Text="Publish Date" runat="server"></asp:Label>
                            </td>
                            <td class="FormLineItemAlt" style="width: 110px; text-align: center;">
                                <asp:Label ID="lblValidDate" Text="Valid to Date" runat="server"></asp:Label>
                            </td>
                            <td class="FormLineItemAlt" style="width: 120px;text-align: center;">
                                <asp:Label ID="lblDocType" Text="Document Type" runat="server"></asp:Label>
                            </td>
                            <td class="FormLineItemAlt" style="width: 80px;text-align: center;">
                                <asp:Label ID="lblDept" Text="Department" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItem">
                                <asp:FileUpload ID="FileUploadControl_1" Width="99%" onchange="GetFileName(this, '1')" runat="server" />
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox Width="99%" ID="txtTitle1" runat="server" ClientIDMode="Static"></asp:TextBox>
                            </td>
                            <td class="FormLineItem">
                                <asp:DropDownList ID="ddlOption_1" runat="server" Width="99%">
                                    <asp:ListItem Value="0">Private</asp:ListItem>
                                    <asp:ListItem Value="1">Public</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox ID="txtPublishDate_01" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="clnExtender" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgPublishDate_01" TargetControlID="txtPublishDate_01">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgPublishDate_01" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox ID="txtValid2Date_01" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="clExtender01" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgValid2Date_01" TargetControlID="txtValid2Date_01" />
                                <asp:ImageButton ID="imgValid2Date_01" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />                            
                            </td>
                            <td class="FormLineItem">
                                <asp:DropDownList ID="ddlDocType_1" Width="99%" runat="server">
                                    <asp:ListItem Value="0">Policy</asp:ListItem>
                                    <asp:ListItem Value="1">Training</asp:ListItem>
                                    <asp:ListItem Value="2">Dealers Standard</asp:ListItem>
                                    <asp:ListItem Value="3">MKT material</asp:ListItem>
                                    <asp:ListItem Value="4">Others</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItem">
                                <asp:DropDownList ID="ddlDept_1" runat="server" Width="99%">
                                    <asp:ListItem Value="ALL">All</asp:ListItem>
                                    <asp:ListItem Value="SAL">Sales</asp:ListItem>
                                    <asp:ListItem Value="PAR">Part</asp:ListItem>
                                    <asp:ListItem Value="SVR">Services</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItemAlt">
                                <asp:FileUpload ID="FileUploadControl_2" Width="99%" onchange="GetFileName(this, '2')" runat="server" />
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:TextBox Width="99%" ID="txtTitle2" ClientIDMode="Static" runat="server"></asp:TextBox>
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:DropDownList ID="ddlOption_2" runat="server" Width="99%">
                                    <asp:ListItem Value="0">Private</asp:ListItem>
                                    <asp:ListItem Value="1">Public</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:TextBox ID="txtPublishDate_02" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="clPublishExtender02" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgPublishDate_02" TargetControlID="txtPublishDate_02">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgPublishDate_02" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:TextBox ID="txtValid2Date_02" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="clValidExtender02" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgValid2Date_02" TargetControlID="txtValid2Date_02" />
                                <asp:ImageButton ID="imgValid2Date_02" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:DropDownList ID="ddlDocType_2" runat="server" Width="99%">
                                    <asp:ListItem Value="0">Policy</asp:ListItem>
                                    <asp:ListItem Value="1">Training</asp:ListItem>
                                    <asp:ListItem Value="2">Dealers Standard</asp:ListItem>
                                    <asp:ListItem Value="3">MKT material</asp:ListItem>
                                    <asp:ListItem Value="4">Others</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:DropDownList ID="ddlDept_2" runat="server" Width="99%">
                                    <asp:ListItem Value="ALL">All</asp:ListItem>
                                    <asp:ListItem Value="SAL">Sales</asp:ListItem>
                                    <asp:ListItem Value="PAR">Part</asp:ListItem>
                                    <asp:ListItem Value="SVR">Services</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItem">
                                <asp:FileUpload ID="FileUploadControl_3" Width="99%" onchange="GetFileName(this, '3')" runat="server" />
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox Width="99%" ID="txtTitle3" ClientIDMode="Static" runat="server"></asp:TextBox>
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:DropDownList ID="ddlOption_3" runat="server" Width="99%">
                                    <asp:ListItem Value="0">Private</asp:ListItem>
                                    <asp:ListItem Value="1">Public</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox ID="txtPublishDate_03" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgPublishDate_03" TargetControlID="txtPublishDate_03">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgPublishDate_03" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox ID="txtValid2Date_03" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="CalendarExtender2" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgValid2Date_03" TargetControlID="txtValid2Date_03" />
                                <asp:ImageButton ID="imgValid2Date_03" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />                            
                            </td>
                            <td class="FormLineItem">
                                <asp:DropDownList ID="ddlDocType_3" runat="server" Width="99%">
                                    <asp:ListItem Value="0">Policy</asp:ListItem>
                                    <asp:ListItem Value="1">Training</asp:ListItem>
                                    <asp:ListItem Value="2">Dealers Standard</asp:ListItem>
                                    <asp:ListItem Value="3">MKT material</asp:ListItem>
                                    <asp:ListItem Value="4">Others</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItem">
                                <asp:DropDownList ID="ddlDept_3" runat="server" Width="99%">
                                    <asp:ListItem Value="ALL">All</asp:ListItem>
                                    <asp:ListItem Value="SAL">Sales</asp:ListItem>
                                    <asp:ListItem Value="PAR">Part</asp:ListItem>
                                    <asp:ListItem Value="SVR">Services</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItemAlt">
                                <asp:FileUpload ID="FileUploadControl_4" Width="99%" onchange="GetFileName(this, '4')" runat="server" />
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:TextBox Width="99%" ID="txtTitle4" ClientIDMode="Static" runat="server"></asp:TextBox>
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:DropDownList ID="ddlOption_4" runat="server" Width="99%">
                                    <asp:ListItem Value="0">Private</asp:ListItem>
                                    <asp:ListItem Value="1">Public</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:TextBox ID="txtPublishDate_04" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="clExtender04" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgPublishDate_04" TargetControlID="txtPublishDate_04" />
                                <asp:ImageButton ID="imgPublishDate_04" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:TextBox ID="txtValid2Date_04" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="txttxtValid2Date_04_CalendarExtender" runat="server" 
                                    Format="dd/MM/yyyy" PopupButtonID="imgValid2Date_04" TargetControlID="txtValid2Date_04" />
                                <asp:ImageButton ID="imgValid2Date_04" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:DropDownList ID="ddlDocType_4" runat="server" Width="99%">
                                    <asp:ListItem Value="0">Policy</asp:ListItem>
                                    <asp:ListItem Value="1">Training</asp:ListItem>
                                    <asp:ListItem Value="2">Dealers Standard</asp:ListItem>
                                    <asp:ListItem Value="3">MKT material</asp:ListItem>
                                    <asp:ListItem Value="4">Others</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:DropDownList ID="ddlDept_4" runat="server" Width="99%">
                                    <asp:ListItem Value="ALL">All</asp:ListItem>
                                    <asp:ListItem Value="SAL">Sales</asp:ListItem>
                                    <asp:ListItem Value="PAR">Part</asp:ListItem>
                                    <asp:ListItem Value="SVR">Services</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItem">
                                <asp:FileUpload ID="FileUploadControl_5" Width="99%" onchange="GetFileName(this, '5')" runat="server" />
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox Width="99%" ID="txtTitle5" ClientIDMode="Static" runat="server"></asp:TextBox>
                            </td>
                            <td class="FormLineItem">
                                <asp:DropDownList ID="ddlOption_5" runat="server" Width="99%">
                                    <asp:ListItem Value="0">Private</asp:ListItem>
                                    <asp:ListItem Value="1">Public</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox ID="txtPublishDate_05" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="clExtender05" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgPublishDate_05" TargetControlID="txtPublishDate_05">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgPublishDate_05" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox ID="txtValid2Date_05" Width="80px" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="CalendarExtender3" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgValid2Date_05" TargetControlID="txtValid2Date_05" />
                                <asp:ImageButton ID="imgValid2Date_05" runat="Server" AlternateText="Click to show calendar" ImageUrl="~/Images/Calendar_scheduleHS.png" />                            
                            </td>
                            <td class="FormLineItem">
                                <asp:DropDownList ID="ddlDocType_5" runat="server" Width="99%">
                                    <asp:ListItem Value="0">Policy</asp:ListItem>
                                    <asp:ListItem Value="1">Training</asp:ListItem>
                                    <asp:ListItem Value="2">Dealers Standard</asp:ListItem>
                                    <asp:ListItem Value="3">MKT material</asp:ListItem>
                                    <asp:ListItem Value="4">Others</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItem">
                                <asp:DropDownList ID="ddlDept_5" runat="server" Width="99%">
                                    <asp:ListItem Value="ALL">All</asp:ListItem>
                                    <asp:ListItem Value="SAL">Sales</asp:ListItem>
                                    <asp:ListItem Value="PAR">Part</asp:ListItem>
                                    <asp:ListItem Value="SVR">Services</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItemAlt" colspan="7">
                                <asp:CheckBox ID="chkSendEmail" Text="Active Send E-mail To Delaers:" 
                                    Checked="true" runat="server" TextAlign="Left" />
                            </td>
                        </tr>
                    </table>
                </div>
                <asp:Button ID="btnAccept" runat="server" Text="Upload" 
                    OnClick="btnAccept_Click" Style="background-image: url('/Images/bgButton.png');
                    background-repeat: no-repeat;" Width="80px" />
                <asp:Label ID="lblError" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger  ControlID="btnAccept" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
</asp:Content>
<asp:Content ID="Content3" runat="server" contentplaceholderid="head">
    <style type="text/css">
        .style16
        {
            background-color: #E8F0E8;
            height: 28px;
        }
    </style>
</asp:Content>

